package main

import (
	"fmt"
	"time"
)

func main()  {
	i := 2
	fmt.Println("Write ",i," as ")

	switch i {
	case 1:
		fmt.Println("one")
	case 2:
		fmt.Println("two")
	case 3:
		fmt.Println("three")
	}

	var cstZone = time.FixedZone("CST", 8*3600)       // 东八
	switch time.Now().In(cstZone).Weekday() {
	case time.Saturday,time.Sunday:
		fmt.Println("It is the Weekend")
	default:
		fmt.Println("It is a Weekday")
	}

	t:=time.Now().In(cstZone)
	switch {
	case t.Hour() < 12:
		fmt.Println("It is before noon")
	default:
		fmt.Println("It is after noon")
	}

	whatAmI := func(i interface{}) {
		switch t:=i.(type) {
		case bool:
			fmt.Println("I am a bool")
		case int:
			fmt.Println("I am a int")
		default:
			fmt.Printf("Don't know type %T\n", t)
		}
	}

	whatAmI(true)
	whatAmI(1)
	whatAmI("hey")
}